package com.share.user.controller;

import com.share.user.command.OrderServiceCommand;
import com.share.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * created by caifan 2018/06/15
 */
@RestController
public class OrderController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/rest/user/{id}")
    public User findById(@PathVariable("id") Long id) {
        OrderServiceCommand orderServiceCommand = new OrderServiceCommand("orderGroup", restTemplate, id);
        return orderServiceCommand.execute();
    }
}
